// 火警警情
import { BasicMarker } from '../../js/BasicMarker.js';
import { BasicMarkers } from '../../js/BasicMarkers.js';
import { getMarkerIcon } from '../../js/icon.js';

class Marker extends BasicMarker {
  constructor({ map, data }) {
    super({ map, data });
    this.type = 'zcsj';
    super.create();
  }
  getIcon() {
    return getMarkerIcon(this.type);
  }
  getPosition(data) {
    return data.lnglat; //本来就是高德坐标
  }
  onClick() {
    // dialog.call(window.$vue, {
    //   content: () => import('@/views/fire-hazard/fire-details.vue'),
    //   contentProps: { details: this.data },
    //   dialogProps: { title: '详情' },
    // });
  }
}

export default class Hjjq extends BasicMarkers {
  constructor({ map, data, paramsData }) {
    super();
    this.map = map;
    this.dataList = data;
    // this.paramsData = paramsData;
  }
  createMarker(data) {
    return new Marker({ map: this.map, data });
  }
  async getDataAsync() {
    return this.dataList && this.dataList.length
      ? this.dataList.map((item) =>
          Object.assign({}, item, {
            lnglat: [item.lng, item.lat],
            longitude: item.lng,
            latitude: item.lat,
          })
        )
      : [];
  }
}
